﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Orders.aspx.cs" Inherits="Orders" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="background-color: Transparent;">
<head runat="server">
    <title>Order Page</title>

    <script language="JavaScript" src="js/CalendarPopup.js"></script>

    <script>
        function checkDate() {

            var isChecked = document.form1["ckbShipperDate"].checked;
            if (isChecked) {
                document.form1["txtShippedDate"].removeAttribute('disabled');
            } else {
                document.form1["txtShippedDate"].setAttribute('disabled', 'disabled');
            }
        }
    </script>

    <script language="JavaScript">
        var cal = new CalendarPopup();
    </script>

    <style type="text/css">
        .style1
        {
            width: 80px;
        }
        .button input
        {
            width: 70px;
            height: 26px;
        }
        .table1 tr
        {
            height: 50px;
        }
        .style3
        {
            width: 80px;
            height: 24px;
        }
        .style4
        {
            height: 24px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <table>
        <tr>
            <td valign="top" width="37%">
                <table border="0" cellpadding="1" cellspacing="1" width="103%">
                    <tr>
                        <td style="color: Maroon; font-size: 22px;">
                            Order Info
                        </td>
                    </tr>
                    <tr>
                        <td width="80" class="style3" valign="top">
                            ID:
                        </td>
                        <td width="226" class="style4">
                            <asp:TextBox ID="txtOrderID" runat="server" Enabled="False"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Customer:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlOrderCustomer" runat="server" Height="22px" Width="142px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Employee:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlOrderEmployee" runat="server" Height="22px" Width="142px">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="ddlOrderEmployee" ErrorMessage="Please choose employee" 
                                ValidationGroup="Order"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Order Date:
                        </td>
                        <td>
                            <asp:TextBox ID="txtOrderDate" NAME="txtOrderDate" runat="server"></asp:TextBox>
                            <a href="#" onclick="cal.select(document.forms['form1'].txtOrderDate,'anchor1','yyyy/MM/dd'); return false;"
                                name="anchor1" id="anchor1">select</a>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                ControlToValidate="txtOrderDate" Display="Dynamic" 
                                ErrorMessage="Please enter the required date" ValidationGroup="Order"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Required Date:
                        </td>
                        <td>
                            <asp:TextBox ID="txtRequiredDate" NAME="txtRequiredDate" runat="server"></asp:TextBox>
                            <a href="#" onclick="cal.select(document.forms['form1'].txtRequiredDate,'anchor1','yyyy/MM/dd'); return false;"
                                name="anchor1" id="a1">select</a>
                            <asp:CompareValidator ID="CompareValidator2" runat="server" 
                                ControlToCompare="txtOrderDate" ControlToValidate="txtRequiredDate" 
                                Display="Dynamic" ErrorMessage="Required date must be greater than Order date" 
                                Operator="GreaterThanEqual" Type="Date" ValidationGroup="Order"></asp:CompareValidator>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                ControlToValidate="txtRequiredDate" Display="Dynamic" 
                                ErrorMessage="Please enter the required date" ValidationGroup="Order"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Shipped Date:
                        </td>
                        <td>
                            <asp:TextBox ID="txtShippedDate" NAME="txtShippedDate"  runat="server" Enabled="False"></asp:TextBox>
                            <a href="#" onclick="cal.select(document.forms['form1'].txtShippedDate,'anchor1','yyyy/MM/dd'); return false;"
                                name="anchor1" id="a2">select</a>
                            <asp:CheckBox ID="ckbShipperDate" name="ckbShipperDate" runat="server" onclick="checkDate()" />
                            <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                ControlToCompare="txtOrderDate" ControlToValidate="txtShippedDate" 
                                Display="Dynamic" ErrorMessage="Shipper date must be greater than order date" 
                                Operator="GreaterThanEqual" Type="Date" ValidationGroup="Order"></asp:CompareValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Shipper ID:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlShipperid" runat="server" Height="22px" Width="142px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Freight:
                        </td>
                        <td>
                            <asp:TextBox ID="txtFreight" runat="server"></asp:TextBox>
                            <asp:RangeValidator ID="RangeValidator4" runat="server" 
                                ControlToValidate="txtFreight" Display="Dynamic" 
                                ErrorMessage="Must be between 0 and 100000000" MaximumValue="1000000000" 
                                MinimumValue="0" Type="Double" ValidationGroup="Order"></asp:RangeValidator>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" 
                                ControlToValidate="txtFreight" Display="Dynamic" 
                                ErrorMessage="Please enter the required field" ValidationGroup="Order"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Ship Name:
                        </td>
                        <td>
                            <asp:TextBox ID="txtShipname" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="txtShipname" Display="Dynamic" 
                                ErrorMessage="Please enter the required field" ValidationGroup="Order"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Ship Addess:
                        </td>
                        <td>
                            <asp:TextBox ID="txtShipaddress" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ControlToValidate="txtShipaddress" Display="Dynamic" 
                                ErrorMessage="Please enter the required field" ValidationGroup="Order"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Ship City:
                        </td>
                        <td>
                            <asp:TextBox ID="txtShipcity" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                ControlToValidate="txtShipcity" Display="Dynamic" 
                                ErrorMessage="Please enter the required field" ValidationGroup="Order"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Ship Region:
                        </td>
                        <td>
                            <asp:TextBox ID="txtShipRegion" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Ship Postal Code:
                        </td>
                        <td>
                            <asp:TextBox ID="txtShipcode" runat="server"></asp:TextBox>
                            <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                ControlToValidate="txtShipcode" Display="Dynamic" 
                                ErrorMessage="Must have 5 numbers or blank" MaximumValue="99999" 
                                MinimumValue="10000" Type="Integer" ValidationGroup="Order"></asp:RangeValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1" valign="top">
                            Ship Country:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlShipCountry" runat="server" Height="22px" Width="142px">
                                <asp:ListItem></asp:ListItem>
                                <asp:ListItem>Afghanistan</asp:ListItem>
                                <asp:ListItem>Afghanistan</asp:ListItem>
                                <asp:ListItem>Albania</asp:ListItem>
                                <asp:ListItem>Algeria</asp:ListItem>
                                <asp:ListItem>Andorra</asp:ListItem>
                                <asp:ListItem>Angola</asp:ListItem>
                                <asp:ListItem>Antigua and Barbuda</asp:ListItem>
                                <asp:ListItem>Argentina</asp:ListItem>
                                <asp:ListItem>Armenia</asp:ListItem>
                                <asp:ListItem>Australia</asp:ListItem>
                                <asp:ListItem>Austria</asp:ListItem>
                                <asp:ListItem>Azerbaijan</asp:ListItem>
                                <asp:ListItem>Bahamas</asp:ListItem>
                                <asp:ListItem>Bahrain</asp:ListItem>
                                <asp:ListItem>Bangladesh</asp:ListItem>
                                <asp:ListItem>Barbados</asp:ListItem>
                                <asp:ListItem>Belarus</asp:ListItem>
                                <asp:ListItem>Belgium</asp:ListItem>
                                <asp:ListItem>Belize</asp:ListItem>
                                <asp:ListItem>Benin</asp:ListItem>
                                <asp:ListItem>Bhutn</asp:ListItem>
                                <asp:ListItem>Bolvia</asp:ListItem>
                                <asp:ListItem>Bosnia</asp:ListItem>
                                <asp:ListItem>Botswana</asp:ListItem>
                                <asp:ListItem>razil</asp:ListItem>
                                <asp:ListItem>Brunei Darussalam</asp:ListItem>
                                <asp:ListItem>Bulgaria</asp:ListItem>
                                <asp:ListItem>Burkina Faso</asp:ListItem>
                                <asp:ListItem>Burma</asp:ListItem>
                                <asp:ListItem>Burundi</asp:ListItem>
                                <asp:ListItem>Cambodia</asp:ListItem>
                                <asp:ListItem>Cameroon</asp:ListItem>
                                <asp:ListItem>Canada</asp:ListItem>
                                <asp:ListItem>Cape Verde</asp:ListItem>
                                <asp:ListItem>Central African Republic</asp:ListItem>
                                <asp:ListItem>Chad</asp:ListItem>
                                <asp:ListItem>Chile</asp:ListItem>
                                <asp:ListItem>China</asp:ListItem>
                                <asp:ListItem>Colombia</asp:ListItem>
                                <asp:ListItem>Comoros</asp:ListItem>
                                <asp:ListItem>Congo</asp:ListItem>
                                <asp:ListItem>Costa Rica</asp:ListItem>
                                <asp:ListItem>Côte d'Ivoire</asp:ListItem>
                                <asp:ListItem>Croatia</asp:ListItem>
                                <asp:ListItem>Cuba</asp:ListItem>
                                <asp:ListItem>Cyprus</asp:ListItem>
                                <asp:ListItem>Czech Republic</asp:ListItem>
                                <asp:ListItem>Denmark</asp:ListItem>
                                <asp:ListItem>Djibouti</asp:ListItem>
                                <asp:ListItem>Dominica</asp:ListItem>
                                <asp:ListItem>Dominican Republic</asp:ListItem>
                                <asp:ListItem>Ecuador</asp:ListItem>
                                <asp:ListItem>Egypt</asp:ListItem>
                                <asp:ListItem>El Salvador</asp:ListItem>
                                <asp:ListItem>quatorial Guinea</asp:ListItem>
                                <asp:ListItem>Eritrea</asp:ListItem>
                                <asp:ListItem>Estonia</asp:ListItem>
                                <asp:ListItem>Ethiopia</asp:ListItem>
                                <asp:ListItem>Fiji</asp:ListItem>
                                <asp:ListItem>Finland</asp:ListItem>
                                <asp:ListItem>France</asp:ListItem>
                                <asp:ListItem>Gabon</asp:ListItem>
                                <asp:ListItem>Gambia</asp:ListItem>
                                <asp:ListItem>Georgia</asp:ListItem>
                                <asp:ListItem>Germany</asp:ListItem>
                                <asp:ListItem>Ghana</asp:ListItem>
                                <asp:ListItem>Greece</asp:ListItem>
                                <asp:ListItem>Grenada</asp:ListItem>
                                <asp:ListItem>Guatemala</asp:ListItem>
                                <asp:ListItem>Guinea</asp:ListItem>
                                <asp:ListItem>Guinea-Bissau</asp:ListItem>
                                <asp:ListItem>Guyana</asp:ListItem>
                                <asp:ListItem>Haiti</asp:ListItem>
                                <asp:ListItem>Honduras</asp:ListItem>
                                <asp:ListItem>Hungary</asp:ListItem>
                                <asp:ListItem>Iceland</asp:ListItem>
                                <asp:ListItem>India</asp:ListItem>
                                <asp:ListItem>Indonesia</asp:ListItem>
                                <asp:ListItem>Iran</asp:ListItem>
                                <asp:ListItem>Iraq</asp:ListItem>
                                <asp:ListItem>Ireland</asp:ListItem>
                                <asp:ListItem>Israel</asp:ListItem>
                                <asp:ListItem>Italy</asp:ListItem>
                                <asp:ListItem>Jamaica</asp:ListItem>
                                <asp:ListItem>Japan</asp:ListItem>
                                <asp:ListItem>Jordan</asp:ListItem>
                                <asp:ListItem>Kazakhstan</asp:ListItem>
                                <asp:ListItem>Kenya</asp:ListItem>
                                <asp:ListItem>Kiribati</asp:ListItem>
                                <asp:ListItem>Korea</asp:ListItem>
                                <asp:ListItem>Kuwait</asp:ListItem>
                                <asp:ListItem>Kyrgyzstan</asp:ListItem>
                                <asp:ListItem>Laos</asp:ListItem>
                                <asp:ListItem>Latvia</asp:ListItem>
                                <asp:ListItem>Lebanon</asp:ListItem>
                                <asp:ListItem>Lesotho</asp:ListItem>
                                <asp:ListItem>Liberia</asp:ListItem>
                                <asp:ListItem>Libya</asp:ListItem>
                                <asp:ListItem>Liechtenstein</asp:ListItem>
                                <asp:ListItem>Lithuania</asp:ListItem>
                                <asp:ListItem>Luxembourg</asp:ListItem>
                                <asp:ListItem>Macedonia</asp:ListItem>
                                <asp:ListItem>Madagascar</asp:ListItem>
                                <asp:ListItem>Malawi</asp:ListItem>
                                <asp:ListItem>Malaysia</asp:ListItem>
                                <asp:ListItem>Maldives</asp:ListItem>
                                <asp:ListItem>Mali</asp:ListItem>
                                <asp:ListItem>Malta</asp:ListItem>
                                <asp:ListItem>Marshall Islands</asp:ListItem>
                                <asp:ListItem>Mauritania</asp:ListItem>
                                <asp:ListItem>Mauritius</asp:ListItem>
                                <asp:ListItem>Mexico</asp:ListItem>
                                <asp:ListItem>Micronesia</asp:ListItem>
                                <asp:ListItem>Moldova</asp:ListItem>
                                <asp:ListItem>Monaco</asp:ListItem>
                                <asp:ListItem>Mongolia</asp:ListItem>
                                <asp:ListItem>Montenegro</asp:ListItem>
                                <asp:ListItem>Morocco</asp:ListItem>
                                <asp:ListItem>Mozambique</asp:ListItem>
                                <asp:ListItem>Myanmar</asp:ListItem>
                                <asp:ListItem>Namibia Nauru</asp:ListItem>
                                <asp:ListItem>Nepal</asp:ListItem>
                                <asp:ListItem>Netherlands</asp:ListItem>
                                <asp:ListItem>New Zealand</asp:ListItem>
                                <asp:ListItem>Nicaragua</asp:ListItem>
                                <asp:ListItem>Niger</asp:ListItem>
                                <asp:ListItem>Nigeria</asp:ListItem>
                                <asp:ListItem>Norway</asp:ListItem>
                                <asp:ListItem>Oman</asp:ListItem>
                                <asp:ListItem>Pakistan</asp:ListItem>
                                <asp:ListItem>Palau</asp:ListItem>
                                <asp:ListItem>Palestinian State</asp:ListItem>
                                <asp:ListItem>Panama</asp:ListItem>
                                <asp:ListItem>Papua New Guinea</asp:ListItem>
                                <asp:ListItem>Paraguay</asp:ListItem>
                                <asp:ListItem>Peru</asp:ListItem>
                                <asp:ListItem>Philippines</asp:ListItem>
                                <asp:ListItem>Poland</asp:ListItem>
                                <asp:ListItem>Portugal</asp:ListItem>
                                <asp:ListItem>Qatar</asp:ListItem>
                                <asp:ListItem>Romania</asp:ListItem>
                                <asp:ListItem>Russia</asp:ListItem>
                                <asp:ListItem>Rwanda</asp:ListItem>
                                <asp:ListItem>St. Kitts and Nevis</asp:ListItem>
                                <asp:ListItem>St. Lucia</asp:ListItem>
                                <asp:ListItem>St. Vincent and The Grenadines</asp:ListItem>
                                <asp:ListItem>Samoa</asp:ListItem>
                                <asp:ListItem>San Marino</asp:ListItem>
                                <asp:ListItem>São Tomé and Príncipe</asp:ListItem>
                                <asp:ListItem>Saudi Arabia</asp:ListItem>
                                <asp:ListItem>Senegal</asp:ListItem>
                                <asp:ListItem>Serbial</asp:ListItem>
                                <asp:ListItem>Seychelles</asp:ListItem>
                                <asp:ListItem>Sierra Leone</asp:ListItem>
                                <asp:ListItem>Singapore</asp:ListItem>
                                <asp:ListItem>Slovakia</asp:ListItem>
                                <asp:ListItem>Slovenia</asp:ListItem>
                                <asp:ListItem>Solomon Islands</asp:ListItem>
                                <asp:ListItem>Somalia</asp:ListItem>
                                <asp:ListItem>South Africa</asp:ListItem>
                                <asp:ListItem>Spain</asp:ListItem>
                                <asp:ListItem>Sri Lanka</asp:ListItem>
                                <asp:ListItem>Sudan</asp:ListItem>
                                <asp:ListItem>Suriname</asp:ListItem>
                                <asp:ListItem>Swaziland</asp:ListItem>
                                <asp:ListItem>Sweden</asp:ListItem>
                                <asp:ListItem>Switzerland</asp:ListItem>
                                <asp:ListItem>Syria</asp:ListItem>
                                <asp:ListItem>Taiwan</asp:ListItem>
                                <asp:ListItem>Tajikistan</asp:ListItem>
                                <asp:ListItem>Tanzania</asp:ListItem>
                                <asp:ListItem>Thailand</asp:ListItem>
                                <asp:ListItem>Togo</asp:ListItem>
                                <asp:ListItem>Tonga</asp:ListItem>
                                <asp:ListItem>Trinidad and Tobago</asp:ListItem>
                                <asp:ListItem>Tunisia</asp:ListItem>
                                <asp:ListItem>Turkey</asp:ListItem>
                                <asp:ListItem>Turkmenistan</asp:ListItem>
                                <asp:ListItem>Tuvalu</asp:ListItem>
                                <asp:ListItem>Uganda </asp:ListItem>
                                <asp:ListItem>Ukraine</asp:ListItem>
                                <asp:ListItem>United Arab Emirates</asp:ListItem>
                                <asp:ListItem>UK</asp:ListItem>
                                <asp:ListItem>USA</asp:ListItem>
                                <asp:ListItem>Uruguay</asp:ListItem>
                                <asp:ListItem>Uzbekistan</asp:ListItem>
                                <asp:ListItem>Vanuatu</asp:ListItem>
                                <asp:ListItem>Vatican City</asp:ListItem>
                                <asp:ListItem>Venezuela</asp:ListItem>
                                <asp:ListItem>Vietnam</asp:ListItem>
                                <asp:ListItem>Western Sahara</asp:ListItem>
                                <asp:ListItem>Yemen</asp:ListItem>
                                <asp:ListItem>Yugoslavia</asp:ListItem>
                                <asp:ListItem>Zaire</asp:ListItem>
                                <asp:ListItem>Zambia</asp:ListItem>
                                <asp:ListItem>Zimbabwe</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                ControlToValidate="ddlShipCountry" ErrorMessage="Please choose country" 
                                ValidationGroup="Order"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr class="button">
                        <td>
                            <asp:Button ID="btnNew" runat="server" Text="New" OnClick="btnNew_Click" 
                                CausesValidation="False" />
                        </td>
                        <td>
                            <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" 
                                ValidationGroup="Order" />
                        </td>
                    </tr>
                    <tr class="button">
                        <td>
                            <asp:Button ID="btnUpdate" runat="server" Text="Update" 
                                OnClick="btnUpdate_Click" ValidationGroup="Order" />
                        </td>
                        <td>
                            <asp:Button ID="btnDelete" runat="server" Text="Delete" 
                                OnClick="btnDelete_Click" CausesValidation="False" />
                        </td>
                    </tr>
                </table>
            </td>
            <td valign="top">
                <table>
                    <tr align="center">
                        <td>
                            Search:
                            <asp:TextBox ID="txtSearch" runat="server" Width="249px"></asp:TextBox>
                            <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div style="width: 850px; height: 325px; overflow: auto">
                                <asp:GridView ID="gvOrders" runat="server"
                                    EnableViewState="False" OnSelectedIndexChanged="gvOrders_SelectedIndexChanged"
                                    AutoGenerateColumns="False" Width="2000px">
                                    <EmptyDataRowStyle Wrap="True" />
                                    <EditRowStyle BorderStyle="None" Wrap="True" />
                                    <Columns>
                                        <asp:BoundField DataField="orderid" HeaderText="ID" />
                                        <asp:BoundField DataField="companyname" HeaderText="Customer ID" />
                                        <asp:BoundField DataField="EmployeeName" HeaderText="Employee ID" />
                                        <asp:BoundField DataField="orderdate" HeaderText="Order Date" />
                                        <asp:BoundField DataField="requireddate" HeaderText="Required Date" />
                                        <asp:BoundField DataField="shippeddate" HeaderText="Shipped Date" />
                                        <asp:BoundField DataField="ShipperCompany" HeaderText="Shipper ID" />
                                        <asp:BoundField DataField="freight" HeaderText="Freight" />
                                        <asp:BoundField DataField="shipname" HeaderText="Ship Name" />
                                        <asp:BoundField DataField="shipaddress" HeaderText="Ship Address" />
                                        <asp:BoundField DataField="shipcity" HeaderText="Ship City" />
                                        <asp:BoundField DataField="shipregion" HeaderText="Ship Region" />
                                        <asp:BoundField DataField="shippostalcode" HeaderText="Ship Postal Code" />
                                        <asp:BoundField DataField="shipcountry" HeaderText="Ship Country" />
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </td>
                    </tr>
                    <tr align="center">
                        <td>
                            <table width="646" style="width: 559px" valign="top">
                                <tr>
                                    <td width="274" valign="top">
                                        Order ID:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtOrderDid" runat="server" Enabled="False" ReadOnly="True"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" 
                                            ControlToValidate="txtOrderDid" Display="Dynamic" 
                                            ErrorMessage="Please select Order" ValidationGroup="OrderD"></asp:RequiredFieldValidator>
                                    </td>
                                    <td width="273" valign="top">
                                        Total:
                                    </td>
                                    <td valign="top">
                                        <asp:TextBox ID="txtOrderDTotal" runat="server" Enabled="False"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr valign="top">
                                    <td valign="top">
                                        Products:
                                    </td>
                                    <td valign="top">
                                        <asp:DropDownList ID="cmbOrderDProductID" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cmbOrderDProductID_SelectedIndexChanged"
                                            Height="22px" Width="142px">
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                            ControlToValidate="cmbOrderDProductID" Display="Dynamic" 
                                            ErrorMessage="Please choose Product" ValidationGroup="OrderD"></asp:RequiredFieldValidator>
                                    </td>
                                    <td  valign="top">
                                        Quantity:
                                    </td>
                                    <td valign="top">
                                        <asp:TextBox ID="numOrderDQuantity" runat="server"></asp:TextBox>
                                        <asp:RangeValidator ID="RangeValidator2" runat="server" 
                                            ControlToValidate="numOrderDQuantity" Display="Dynamic" 
                                            ErrorMessage="Must be between 0 and 1000000000" MaximumValue="1000000000" 
                                            MinimumValue="1" Type="Integer" ValidationGroup="OrderD"></asp:RangeValidator>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                            ControlToValidate="numOrderDQuantity" Display="Dynamic" 
                                            ErrorMessage="Please enter the required field" ValidationGroup="OrderD"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top">
                                        Unit Price:
                                    </td>
                                    <td valign="top">
                                        <asp:TextBox ID="txtOrderDPrice" runat="server" Enabled="False" ReadOnly="True"></asp:TextBox>
                                    </td>
                                    <td valign="top">
                                        Discount:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="numOrderDDiscount" runat="server"></asp:TextBox>
                                        <asp:RangeValidator ID="RangeValidator3" runat="server" 
                                            ControlToValidate="numOrderDDiscount" Display="Dynamic" 
                                            ErrorMessage="Must be between 0% and 100%" MaximumValue="100" MinimumValue="0" 
                                            Type="Double" ValidationGroup="OrderD"></asp:RangeValidator>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                                            ControlToValidate="numOrderDDiscount" Display="Dynamic" 
                                            ErrorMessage="Please enter the required field" ValidationGroup="OrderD"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr class="button">
                                    <td>
                                        <asp:Button ID="btnOrderDNew" runat="server" Text="New" Height="26px" OnClick="btnOrderDNew_Click" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnOrderDAdd" runat="server" Text="Add" 
                                            OnClick="btnOrderDAdd_Click" ValidationGroup="OrderD" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnOrderDUpdate" runat="server" Text="Update" Enabled="False" 
                                            OnClick="btnOrderDUpdate_Click" ValidationGroup="OrderD" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnOrderDDelete" runat="server" Text="Delete" Enabled="False" OnClick="btnOrderDDelete_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr align="center">
                        <td>
                            <asp:GridView ID="gvDetails" runat="server" OnPageIndexChanging="gvDetails_PageIndexChanging"
                                OnSelectedIndexChanged="gvDetails_SelectedIndexChanged">
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
